package com.lin.servlet;

import java.util.List;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.lin.service.BookServiceImpl;
import com.lin.service.IBookService;
import com.lin.service.IOrderService;
import com.lin.service.OrderServiceImpl;
import com.lin.utils.BaseServlet;
import com.lin.vo.Book;
import com.lin.vo.Order;
@WebServlet(name="AdminOrderServlet",urlPatterns={"/adminOrderServlet"})
public class AdminOrderServlet extends BaseServlet {

	private static final long serialVersionUID = 1L;
	private IOrderService orderService =new OrderServiceImpl();
	public String findAllOrders(HttpServletRequest request ,HttpServletResponse response){
		/**
		 * 1.获取状态参数信息
		 */
		String state = request.getParameter("state");
		List<Order> orderLists=null;
		if(state == null || "".equals(state)){
			orderLists = orderService.findByAllOrders();	
		}else{
			int value = Integer.parseInt(state);
			orderLists=orderService.findByAllOrders(value);
		}
		request.setAttribute("orderLists", orderLists);
		return "change:/adminjsps/admin/order/list.jsp";

	}
}
